<script type="text/javascript">
$("#checkAll").checkall({itemName : "id"});
</script>
<#include "/component/pagination.html" />
<!-- <script type="text/javascript" src="${basePath}/js/tds-alarm.js"></script> -->
<input id="nodeForPager" name="nodeForPager" type="hidden" value="${nodeForPager!}"/>
<input id="statusForPager" name="statusForPager" type="hidden" value="${statusForPager!}"/>
<input id="typeForPager" name="typeForPager" type="hidden" value="${typeForPager!}"/>
<input id="begintimeForPager" name="begintimeForPager" type="hidden" value="${(begintimeForPager)!}"/>
<input id="endtimeForPager" name="endtimeForPager" type="hidden" value="${(endtimeForPager)!}"/>
<input id="importanceForPager" name="importanceForPager" type="hidden" value="${(importanceForPager)!}"/>
<input id="historyForPager" name="historyForPager" type="hidden" value="${(historyForPager)!}"/>
	<div class="apos" >
	<#if historyForPager != 1>
	<a id="readalarmBtn" class="btn btn-primary" style="float:left;"
		href="javascript:void(0);" onclick="alarm.read()" ><@spring.message code='alarm.read'/></a>
	</#if>
	<a id="readalarmBtn" class="btn btn-primary"  
		href="javascript:void(0);" onclick="alarm.remove()"><@spring.message code='button.remove'/></a>
	</div>
<table class="table table-striped table-hover">
	<thead>
		<tr>
			<th width="3%" scope="col"><input
				id="checkAll" type="checkbox" /></th>
			<th width="10%" scope="col"><@spring.message code='alarm.name'/></th>
			<th width="20%" scope="col"><@spring.message code='alarm.ip'/></th>
			<th width="20%" scope="col"><@spring.message code='alarm.content'/></th>
			<th width="20%" scope="col"><@spring.message code='alarm.type'/></th>
			<th width="10%" scope="col"><@spring.message code='alarm.importance'/></th>
			<th width="20%" scope="col"><@spring.message code='alarm.createTime'/></th>
		</tr>
	</thead>
	<tbody>
		<#list pager.list as item>
		<tr  
			<#if ((item_index+1) % 2 == 0) >class="oddrow"</#if> >
			<td class="c"><input name="id" type="checkbox" value="${item.id}" /></td>
			<td>${item.hostname}</td>
	        <td>${item.ip}</td>
	        <td>${item.contentKey}</td>
	        <td><@spring.message code='alarm.type${item.type}'/></td>
	        <td>
	        <#switch item.importance>
	        	<#case 0>
					<@spring.message code='threshold.invalid'/>
				<#break>
				<#case 1>
					<@spring.message code='threshold.low'/>
				<#break>
				<#case 2>
					<@spring.message code='threshold.middle'/>
				<#break>
				<#case 3>
					<@spring.message code='threshold.high'/>
				<#break>
			</#switch>
			</td>
	        <td>${item.createTime?string('yyyy-MM-dd HH:mm:ss')}</td>
	    </tr>
		</#list>
	</tbody>
</table>
<@pagination/>
